﻿Public Class frmStatistics

    ' Load

    Private Sub frmStatistics_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'Hide Main menu labels

        lblHome.Visible = False
        lblVisit.Visible = False
        lblSurvey.Visible = False
        'lblStatistics.Visible = False
        lblInventory.Visible = False
        lblEmployee.Visible = False
        lblClose.Visible = False

        btnEmployeeReport.Image = StatisticsImageSet.Images("Go")
        btnInventoryReport.Image = StatisticsImageSet.Images("Go")
        btnQuickVisitReport.Image = StatisticsImageSet.Images("Go")
        btnDetailesVisitReport.Image = StatisticsImageSet.Images("Go")
        btnSellsReport.Image = StatisticsImageSet.Images("Go")
        btnEmpPerfReport.Image = StatisticsImageSet.Images("Go")
        btnResultsByAge.Image = StatisticsImageSet.Images("Go")
        btnResultsByTown.Image = StatisticsImageSet.Images("Go")
        btnResultsByGender.Image = StatisticsImageSet.Images("Go")
        btnPublicityResults.Image = StatisticsImageSet.Images("Go")
    End Sub

    '*********************
    ' Mouse Over Buttons *
    ''********************

    Private Sub btnEmployeeReport_MouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmployeeReport.MouseHover
        lblEmployeeReport.ForeColor = Color.DarkOrange
        btnEmployeeReport.Image = StatisticsImageSet.Images("GoSelected")
    End Sub

    Private Sub btnInventoryReport_MouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInventoryReport.MouseHover
        lblInventoryReport.ForeColor = Color.DarkOrange
        btnInventoryReport.Image = StatisticsImageSet.Images("GoSelected")
    End Sub

    Private Sub btnQuickVisitReport_MouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuickVisitReport.MouseHover
        lblQuickVisitReport.ForeColor = Color.DarkOrange
        btnQuickVisitReport.Image = StatisticsImageSet.Images("GoSelected")
    End Sub

    Private Sub btnDetailesVisitReport_MouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDetailesVisitReport.MouseHover
        lblDetailedVisitReport.ForeColor = Color.DarkOrange
        btnDetailesVisitReport.Image = StatisticsImageSet.Images("GoSelected")
    End Sub

    Private Sub btnSellsReport_MouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSellsReport.MouseHover
        lblSellsReport.ForeColor = Color.DarkOrange
        btnSellsReport.Image = StatisticsImageSet.Images("GoSelected")
    End Sub

    Private Sub btnEmpPerfReport_MouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmpPerfReport.MouseHover
        lblEmpPerfReport.ForeColor = Color.DarkOrange
        btnEmpPerfReport.Image = StatisticsImageSet.Images("GoSelected")
    End Sub

    Private Sub btnResultsByAge_MouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResultsByAge.MouseHover
        lblResultsByAge.ForeColor = Color.DarkOrange
        btnResultsByAge.Image = StatisticsImageSet.Images("GoSelected")
    End Sub

    Private Sub btnResultsByTown_MouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResultsByTown.MouseHover
        lblResultsByTown.ForeColor = Color.DarkOrange
        btnResultsByTown.Image = StatisticsImageSet.Images("GoSelected")
    End Sub

    Private Sub btnResultsByGender_MouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResultsByGender.MouseHover
        lblResultsByGender.ForeColor = Color.DarkOrange
        btnResultsByGender.Image = StatisticsImageSet.Images("GoSelected")
    End Sub

    Private Sub btnPublicityResults_MouseOver(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPublicityResults.MouseHover
        lblPublicityResults.ForeColor = Color.DarkOrange
        btnPublicityResults.Image = StatisticsImageSet.Images("GoSelected")
    End Sub


    '**********************
    ' Mouse Leave Buttons *
    ''*********************

    Private Sub btnEmployeeReport_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmployeeReport.MouseLeave
        lblEmployeeReport.ForeColor = Color.White
        btnEmployeeReport.Image = StatisticsImageSet.Images("Go")
    End Sub

    Private Sub btnInventoryReport_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInventoryReport.MouseLeave
        lblInventoryReport.ForeColor = Color.White
        btnInventoryReport.Image = StatisticsImageSet.Images("Go")
    End Sub

    Private Sub btnQuickVisitReport_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuickVisitReport.MouseLeave
        lblQuickVisitReport.ForeColor = Color.White
        btnQuickVisitReport.Image = StatisticsImageSet.Images("Go")
    End Sub

    Private Sub btnDetailesVisitReport_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDetailesVisitReport.MouseLeave
        lblDetailedVisitReport.ForeColor = Color.White
        btnDetailesVisitReport.Image = StatisticsImageSet.Images("Go")
    End Sub

    Private Sub btnSellsReport_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSellsReport.MouseLeave
        lblSellsReport.ForeColor = Color.White
        btnSellsReport.Image = StatisticsImageSet.Images("Go")
    End Sub

    Private Sub btnEmpPerfReport_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmpPerfReport.MouseLeave
        lblEmpPerfReport.ForeColor = Color.White
        btnEmpPerfReport.Image = StatisticsImageSet.Images("Go")
    End Sub

    Private Sub btnResultsByAge_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResultsByAge.MouseLeave
        lblResultsByAge.ForeColor = Color.White
        btnResultsByAge.Image = StatisticsImageSet.Images("Go")
    End Sub

    Private Sub btnResultsByTown_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResultsByTown.MouseLeave
        lblResultsByTown.ForeColor = Color.White
        btnResultsByTown.Image = StatisticsImageSet.Images("Go")
    End Sub

    Private Sub btnResultsByGender_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResultsByGender.MouseLeave
        lblResultsByGender.ForeColor = Color.White
        btnResultsByGender.Image = StatisticsImageSet.Images("Go")
    End Sub

    Private Sub btnPublicityResults_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPublicityResults.MouseLeave
        lblPublicityResults.ForeColor = Color.White
        btnPublicityResults.Image = StatisticsImageSet.Images("Go")
    End Sub

    '************************
    ' Loads selected report *
    ''***********************

    Private Sub btnEmployeeReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmployeeReport.Click
        My.Forms.frmEmployeeReport.Show()
        My.Forms.frmEmployeeReport.ReportViewer.Refresh()
    End Sub

    Private Sub btnInventoryReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInventoryReport.Click
        My.Forms.frmInventoryReport.Show()
        My.Forms.frmInventoryReport.ReportViewer.Refresh()
    End Sub

    Private Sub btnQuickVisitReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuickVisitReport.Click
        My.Forms.frmQuickVisitReport.Show()
        My.Forms.frmQuickVisitReport.ReportViewer.Refresh()
    End Sub

    Private Sub btnDetailesVisitReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDetailesVisitReport.Click
        My.Forms.frmDetailedVisitReport.Show()
        My.Forms.frmDetailedVisitReport.ReportViewer.Refresh()
    End Sub

    Private Sub btnSellsReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSellsReport.Click
        My.Forms.frmSellsReport.Show()
        My.Forms.frmSellsReport.ReportViewer.Refresh()
    End Sub

    Private Sub btnEmpPerfReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmpPerfReport.Click
        My.Forms.frmEmployeePerformanceReport.Show()
        My.Forms.frmEmployeePerformanceReport.ReportViewer.Refresh()
    End Sub

    Private Sub btnResultsByAge_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResultsByAge.Click
        My.Forms.frmResultsByAge.Show()
        My.Forms.frmResultsByAge.ReportViewer.Refresh()
    End Sub

    Private Sub btnResultsByTown_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResultsByTown.Click
        My.Forms.frmResultsByTown.Show()
        My.Forms.frmResultsByTown.ReportViewer.Refresh()
    End Sub

    Private Sub btnResultsByGender_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResultsByGender.Click
        My.Forms.frmResultsByGender.Show()
        My.Forms.frmResultsByGender.ReportViewer.Refresh()
    End Sub

    Private Sub btnPublicityResults_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPublicityResults.Click
        My.Forms.frmPublicityResults.Show()
        My.Forms.frmPublicityResults.ReportViewer.Refresh()
    End Sub

    '************************************************
    ' Show the label for the items on the main menu *
    '************************************************

    Private Sub btnHome_MouseOver(ByVal sender As System.Object, _
                  ByVal e As System.EventArgs) Handles btnHome.MouseHover
        lblHome.Visible = True
    End Sub

    Private Sub btnVisit_MouseOver(ByVal sender As System.Object, _
                  ByVal e As System.EventArgs) Handles btnVisit.MouseHover
        lblVisit.Visible = True
    End Sub

    Private Sub btnSurvey_MouseOver(ByVal sender As System.Object, _
                  ByVal e As System.EventArgs) Handles btnSurvey.MouseHover
        lblSurvey.Visible = True
    End Sub

    Private Sub btnEmployee_MouseOver(ByVal sender As System.Object, _
              ByVal e As System.EventArgs) Handles btnEmployee.MouseHover
        lblEmployee.Visible = True
    End Sub

    Private Sub btnInventory_MouseOver(ByVal sender As System.Object, _
                  ByVal e As System.EventArgs) Handles btnInventory.MouseHover
        lblInventory.Visible = True
    End Sub

    Private Sub btnClose_MouseOver(ByVal sender As System.Object, _
                  ByVal e As System.EventArgs) Handles btnClose.MouseHover
        lblClose.Visible = True
    End Sub



    '**************************************
    ' Hides the labels from the main menu *
    '**************************************


    Private Sub btnHome_MouseLeave(ByVal sender As System.Object, _
              ByVal e As System.EventArgs) Handles btnHome.MouseLeave
        lblHome.Visible = False
    End Sub

    Private Sub btnVisit_MouseLeave(ByVal sender As System.Object, _
                  ByVal e As System.EventArgs) Handles btnVisit.MouseLeave
        lblVisit.Visible = False
    End Sub

    Private Sub btnEmployee_MouseLeave(ByVal sender As System.Object, _
              ByVal e As System.EventArgs) Handles btnEmployee.MouseLeave
        lblEmployee.Visible = False
    End Sub

    Private Sub btnSurvey_MouseLeave(ByVal sender As System.Object, _
              ByVal e As System.EventArgs) Handles btnSurvey.MouseLeave
        lblSurvey.Visible = False
    End Sub

    Private Sub btnStatistics_MouseLeave(ByVal sender As System.Object, _
                  ByVal e As System.EventArgs) Handles btnStatistics.MouseLeave
        lblStatistics.Visible = False
    End Sub

    Private Sub btnInventory_MouseLeave(ByVal sender As System.Object, _
                  ByVal e As System.EventArgs) Handles btnInventory.MouseLeave
        lblInventory.Visible = False
    End Sub

    Private Sub btnClose_MouseLeave(ByVal sender As System.Object, _
                  ByVal e As System.EventArgs) Handles btnClose.MouseLeave
        lblClose.Visible = False
    End Sub

    '***************************************
    ' Control the buttons of the main menu *
    '***************************************

    Private Sub btnClose_Visit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        Dim Confirmation As MsgBoxResult
        Confirmation = MessageBox.Show("Unsaved changes will be lost. Are you sure you want to exit?", _
                                       "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
        If Confirmation = MsgBoxResult.Yes Then
            CloseAllForms()
        End If
    End Sub

    Private Sub btnHome_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHome.Click
        SwitchForm(My.Forms.frmMain)
    End Sub

    Private Sub btnVisit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVisit.Click
        SwitchForm(My.Forms.frmQuickVisit)
    End Sub

    Private Sub btnSurvey_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSurvey.Click
        SwitchForm(My.Forms.frmSurvey)
    End Sub

    Private Sub btnStatistics_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStatistics.Click
        'SwitchForm(My.Forms.frmSurvey)
    End Sub

    Private Sub btnInventory_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInventory.Click
        SwitchForm(My.Forms.frmViewInventory)
    End Sub

    Private Sub btnEmployee_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEmployee.Click
        SwitchForm(My.Forms.frmViewEmployee)
    End Sub

End Class